#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>


/*int a[100][100];
int total; */



/*struct tani
{
char tukang[30];
char alamat[30];
float gaji;
}; */

struct lahan
{
char nama[30];
char area[30];
int luas;
/*char tanaman[30];
tani anggur[100]; */
}park_buah[100];

void main()
{

int x,y,z,i,j,k,u[100],c;
char milih;
ulang:

cout<<"Perkebunan";
cout<<"\n1. Input Data";
cout<<"\n2. View Data";
cout<<"\n3. Keluar";
cout<<"\nmasukkan pilihan anda : ";
cin>>c;
cout<<"\n";

switch(c)
{
	case 1:
   clrscr();
   cout<<"\nMasukkan Jumlah Kebun : ";
   cin>>y;
	x=0;
	for (i=0;i<y;i++)
   {
   cout<<"\nMasukkan Lahan ke "<<(i+1);
   cout<<"\nNama Kebun : ";
   gets(park_buah[i].nama);
	cout<<"\nArea Kebun : ";
	gets(park_buah[i].area);
	cout<<"\nLuas Kebun : ";
	cin>>park_buah[i].luas;
 /*	cout<<"\nTanaman    : ";
	cin>>park_buah[i].tanaman;

		cout<<"\nMasukkan banyak Tukang : ";
		cin>>z;
      u[x]=z;
      for (j=0;j<u[x];j++)
      {

   	   cout<<"\nData Tukang Ke- : "<<(j+1);
      	cout<<"\nNama Tukang : ";
     	 	cin>>park_buah[i].anggur[j].tukang;
      	cout<<"\nAlamat      : ";
      	cin>>park_buah[i].anggur[j].alamat;
         cout<<"\nGaji        : ";
         cin>>park_buah[i].anggur[j].gaji;
         a[i][j]=park_buah[i].anggur[j].gaji;
      }

   x++; */
	}
   break;

  	case 2:
   clrscr();
  // int m=0;
   k=0;
   cout<<"===================================================";
   gotoxy(1,2);
   cout<<"Nama Kebun ";
   gotoxy(20,2);
   cout<<"Area Kebun ";
   gotoxy(40,2);
   cout<<"Luas Kebun";
   cout<<"===================================================";

	for (i=0;i<y;i++)
	{
     /*	total=0;
     	cout<<"\nData Lahan ke "<<(i+1);   */
      gotoxy(1,i+4);
		cout<<(i+1)<<" "<<park_buah[i].nama;
      gotoxy(20,i+4);
		cout<<park_buah[i].area;
      gotoxy(40,i+4);
		cout<<park_buah[i].luas;
/*	 	cout<<"\nTanaman    : "<<park_buah[i].tanaman;

	for (j=0;j<u[k];j++)
   	{
      cout<<"\nData Tukang Ke- : "<<(j+1);
      cout<<"\nNama Tukang : "<<park_buah[i].anggur[j].tukang;
      cout<<"\nAlamat      : "<<park_buah[i].anggur[j].alamat;
	  // cout<<"\nTotal Gaji  : "<<park_buah[i].anggur[j].gaji;
      cout<<"\n==============================================\n";

      }
   for (j=0;j<u[m];j++)
   	{
   		total=total+a[i][j];
   	}
      cout<<"\nGaji Total : "<<total;
   k++;   */
	}
   
	cout<<"\n===================================================";
  	break;
	case 3:
   default:
   exit(1);
   break;
}
cout<<"\nApakah anda ingin mengulang?(y/t) : ";
cout<<milih;
if(milih=='y'|| milih=='Y')
{
clrscr();
goto ulang;
}
getch();
}
